home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / rjs.lha / RJS / tests / iclient.C < prev    next >
C/C++ Source or Header  |  1991-06-14  |  1KB  |  67 lines

  1. #include <iostream.h>
  2. #include <stdio.h>
  3. #include <osfcn.h>
  4. #include <libc.h>
  5.  
  6. #include "RJS/Transport.h"
  7. #include "RJS/NDR.h"
  8. #include "RJS/KernelVar.h"
  9. #include "Date.h"
  10. #include "XKernelVar.h"
  11.  
  12. int main(int argc, char *argv[]) 
  13. {
  14.  
  15.  
  16.   if (argc!=3) { cerr << "usage: " << argv[0] << " server port" << endl;exit(1); }
  17.  
  18.   InetStream server;
  19.   server.socket_client(InetAddress(argv[1],atoi(argv[2])));
  20.  
  21.   char buffer[1024];
  22.   NDR_receive ndr;
  23.   ndr.init(buffer,1024);
  24.   
  25.   server >> ndr;
  26.  
  27. cout << ndr;
  28.  
  29. Date bd;
  30. char m1[32];
  31. char  m2[32];
  32. char  test2[5];
  33. int count;
  34. char c;
  35. short s;
  36. unsigned short us;
  37. int i;
  38. float f;
  39. double d;
  40. Xkern_loadav load;
  41. double d1[3];
  42. cout << "Decoding..." << endl;
  43.  
  44. ndr >> c >> s >> i >> us >> m1 >> bd >> m2 >> f >> d >> load;
  45. ndr.extract(test2,count);
  46.  
  47. cout << "c  = " << c << endl;
  48. cout << "s  = " << s << endl;
  49. cout << "i  = " << i << endl;
  50. cout << "us  = " << us << endl;
  51.  
  52. cout << "m1  = " << m1 << endl;
  53.  
  54. cout << "bd  = " << bd << endl;
  55.  
  56. cout << "m2  = " << m2 << endl;
  57. cout << "f   = " << f  << endl;
  58. cout << "d   = " << d  << endl;
  59. cout << "d1  = " << d1[0] << " " << d1[1] << " " << d1[2] << " " << endl;
  60. cout << "load  = " << load  << endl;
  61. cout << "test2 = " << test2[0] << test2[1] << test2[2] << test2[3] << test2[4] << endl;
  62. cout << "count = " << count << endl;
  63.  
  64.   exit(0);
  65. }
  66.  
  67.